﻿Public Class MainForm
    Dim examMgm As ExamMgm = New ExamMgm()
    Dim stuMgm As StudentMgm = New StudentMgm()
    Dim questionMgm As SelectQuestions = New SelectQuestions()
    Private Sub ExamMgmToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles ExamMgmToolStripMenuItem.Click
        ShowExamMgm()
    End Sub

    Private Sub ShowExamMgm()
        stuMgm.Hide()
        questionMgm.Hide()

        examMgm.MdiParent = Me
        examMgm.FormBorderStyle = FormBorderStyle.None
        examMgm.Show()
    End Sub

    Private Sub MainForm_Load(sender As Object, e As EventArgs) Handles MyBase.Load
        ShowExamMgm()
    End Sub

    Private Sub QuestionToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles QuestionToolStripMenuItem.Click
        ShowQuesionMgm()
    End Sub

    Private Sub ShowQuesionMgm()
        examMgm.Hide()
        stuMgm.Hide()

        questionMgm.MdiParent = Me
        questionMgm.FormBorderStyle = FormBorderStyle.None
        questionMgm.StartPosition = FormStartPosition.Manual
        questionMgm.ClientSize = New System.Drawing.Size(1179, 613)
        questionMgm.MaximumSize = New System.Drawing.Size(1179, 613)
        questionMgm.MinimumSize = New System.Drawing.Size(1179, 613)
        questionMgm.Show()
    End Sub

    Private Sub StudentMgmToolStripMenuItem1_Click(sender As Object, e As EventArgs) Handles StudentMgmToolStripMenuItem1.Click
        ShowStuMgm()
    End Sub

    Private Sub ShowStuMgm()
        examMgm.Hide()
        questionMgm.Hide()

        stuMgm.MdiParent = Me
        stuMgm.FormBorderStyle = FormBorderStyle.None
        stuMgm.Show()
    End Sub

    Private Sub CreateNewStuToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles CreateNewStuToolStripMenuItem.Click
        ShowStuMgm()
        stuMgm.CreateNewStu()
        stuMgm.refreshData()

    End Sub

    Private Sub StuImportToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles StuImportToolStripMenuItem.Click
        ShowStuMgm()
        stuMgm.StuImportFromExcel()
    End Sub

    Private Sub ExitToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles ExitToolStripMenuItem.Click
        End
    End Sub

    Private Sub CreateQuesionToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles CreateQuesionToolStripMenuItem.Click
        ShowQuesionMgm()
        questionMgm.CreateNewQuestion()

    End Sub

    Private Sub SubImportToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles SubImportToolStripMenuItem.Click
        ShowQuesionMgm()
        questionMgm.ImportQuesions()
    End Sub
End Class